<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/2001/XMLSchema">
<head>
    <meta charset="UTF-8">
    <title>Vue组件</title>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
</head>
<body>

<div id="app">
    <title1></title1>
    <!--
    <ul>
        <li v-for="item in items">{{item}}</li>
    </ul>
    -->
    <ul>
        <list v-for="item in items" v-bind:item="item"></list>
    </ul>
</div>

<script>
    Vue.component("title1", {
        template: "<h1>Vue组件</h1>"
    });
    Vue.component("list", {
        props: ['item'],
        template: "<li>{{item}}</li>"
    });
    let vue = new Vue({
        el: "#app",
        data: {
            items: ["java", "前端", "android"]
        },
    });
</script>

</body>
</html>